<html>
<head><meta charset="utf-8"><title>rustc development · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html">rustc development</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="183490005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490005">(Dec 15 2019 at 14:19)</a>:</h4>
<p>I'm trying to run <code>rust-analyzer</code> while working on rustc. Since I'm mostly working on stage1, I set</p>
<ul>
<li><code>rustup override set beta</code></li>
<li><code>env RUSTC_BOOTSTRAP=1 RUSTFLAGS=--cfg=bootstrap</code> before launching <code>code</code></li>
</ul>



<a name="183490009"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490009" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490009">(Dec 15 2019 at 14:19)</a>:</h4>
<p>This gets me beyond libcore at least, but then I get amusing errors :D</p>



<a name="183490055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490055">(Dec 15 2019 at 14:20)</a>:</h4>
<blockquote>
<p>the size for values of type <code>Stream</code> cannot be known at compilation time<br>
the trait <code>core::marker::Sized</code> is not implemented for <code>Stream</code><br>
to learn more, visit &lt;<a href="https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait" target="_blank" title="https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait">https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait</a>&gt;</p>
</blockquote>



<a name="183490064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490064">(Dec 15 2019 at 14:21)</a>:</h4>
<p>There's two things amusing about this, the errors themselves (there's more like <code>can't index "Vec&lt;&amp;str&gt;"</code> and similar</p>



<a name="183490072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490072">(Dec 15 2019 at 14:21)</a>:</h4>
<p>The second amusing thing is that I get paths like <code>/home/oliver/Projects/rust/rustc/workdirs/rust7/home/oliver/.cargo/registry/src/github.com-1ecc6299db9ec823/atty-0.2.11/src/lib.rs</code></p>



<a name="183490112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490112">(Dec 15 2019 at 14:22)</a>:</h4>
<p>Note that my pwd is <code>/home/oliver/Projects/rust/rustc/workdis/rust7</code></p>



<a name="183490115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490115">(Dec 15 2019 at 14:22)</a>:</h4>
<p>I'll keep posting here with my progress</p>



<a name="183490184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490184">(Dec 15 2019 at 14:25)</a>:</h4>
<p>I'm moderately certain that the <code>Sized</code> errors are happening because of bootstrapping issues where the <code>beta</code> libcore and the stage0 libcore are somehow messing with everything</p>



<a name="183490231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490231">(Dec 15 2019 at 14:26)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> these errors are from running <code>cargo watch</code>, which internally is using <code>cargo check</code>. I think vanilla <code>cargo check</code> won't work with rustc though</p>



<a name="183490237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490237">(Dec 15 2019 at 14:26)</a>:</h4>
<p>So perhaps the best solution here is to override <code>cargo check</code> command with appropriate <code>./x.py check</code> (there's a config option for that).</p>



<a name="183490239"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490239" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490239">(Dec 15 2019 at 14:26)</a>:</h4>
<p>oh</p>



<a name="183490240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490240">(Dec 15 2019 at 14:26)</a>:</h4>
<p>neat</p>



<a name="183490244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490244">(Dec 15 2019 at 14:27)</a>:</h4>
<p>/me tries</p>



<a name="183490296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490296">(Dec 15 2019 at 14:28)</a>:</h4>
<p>Note that I personally don't use <code>cargo watch</code> functionality: for me the lag on non-trivial projects is significant, so I stick with just invoking an approriate complation command with a shortcut (which still gives you inline errors, which are <em>not</em> updated as you type)</p>



<a name="183490364"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490364" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490364">(Dec 15 2019 at 14:30)</a>:</h4>
<p>oh I didn't know that existed</p>



<a name="183490436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490436">(Dec 15 2019 at 14:32)</a>:</h4>
<p>The shortcut to run compilation? There are two of them:</p>
<ul>
<li>one which runs a VS Code task. This is what I use for rustc, by having this in my config:</li>
</ul>
<div class="codehilite"><pre><span></span><span class="mi">15</span>:<span class="mi">30</span>:<span class="mi">31</span><span class="o">|~</span><span class="w"></span>
<span class="err">λ</span><span class="w"> </span><span class="n">bat</span><span class="w"> </span><span class="o">~/</span><span class="n">projects</span><span class="o">/</span><span class="n">rust</span><span class="o">/</span><span class="p">.</span><span class="n">vscode</span><span class="o">/</span><span class="n">tasks</span><span class="p">.</span><span class="n">json</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="s">&quot;version&quot;</span>: <span class="s">&quot;2.0.0&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">    </span><span class="s">&quot;tasks&quot;</span>: <span class="p">[</span><span class="w"></span>
<span class="w">        </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="s">&quot;label&quot;</span>: <span class="s">&quot;check&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="s">&quot;type&quot;</span>: <span class="s">&quot;shell&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="s">&quot;command&quot;</span>: <span class="s">&quot;./x.py check&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="s">&quot;problemMatcher&quot;</span>: <span class="s">&quot;$rustc&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="s">&quot;group&quot;</span>: <span class="s">&quot;build&quot;</span><span class="p">,</span><span class="w"></span>
<span class="w">            </span><span class="s">&quot;presentation&quot;</span>: <span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="s">&quot;clear&quot;</span>: <span class="nc">true</span><span class="w"></span>
<span class="w">            </span><span class="p">}</span><span class="w"></span>
<span class="w">        </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">]</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<ul>
<li>one which compiles/runs thing at cursor (if the cursor is on <code>#[test]</code>, thet test will be run, if on <code>fn main</code>, that binary, otherwise, the crate at cursor will be compiled). This is what I use when hacking on rust-analyzer, but it needs a proper cargo build to function</li>
</ul>



<a name="183490612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/183490612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#183490612">(Dec 15 2019 at 14:38)</a>:</h4>
<p>Oh that's even better, then I can keep building everything on the remote machine</p>



<a name="184486074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/184486074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#184486074">(Dec 30 2019 at 17:20)</a>:</h4>
<p>I just tried <code>rust-analyzer</code> with rustc. It seems to work pretty well. Having path contexts in VS Code is quite handy for large impls. It does give errors about <code>static move || { yield }</code> though.</p>



<a name="184486249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/rustc%20development/near/184486249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/rustc.20development.html#184486249">(Dec 30 2019 at 17:23)</a>:</h4>
<p>Oh, it can goto proc macro impls too :D</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>